package com.itheima.example.consumer;

import com.itheima.example.common.model.User;
import com.itheima.example.common.service.UserService;
import com.itheima.weirpc.proxy.ServiceProxyFactory;

/**
 * ClassName: EasyConsumerExample
 * Package: com.itheima.example.consumer
 * Description:
 *
 * @Author 看到风
 * @Create 2024/11/13 17:08
 * @Version 1.0
 */
public class EasyConsumerExample {
    public static void main(String[] args) {
        //TODO 需要获取UserService的实现类对象
//        UserService userService = null;
//        UserService userService = new UserServiceProxy();
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("weihe");
        //调用
        User newUser = userService.getUser(user);

        if(newUser!=null){
            System.out.println(newUser.getName());
        }
        else{
            System.out.println("user == null");
        }
//        long number = userService.getNumber();
//        System.out.println(number);
    }
}
